#include "E_Pthread_Pool.h"
#include "iostream"
#include "string"

using namespace std;

class my_tast : public Task{
public:
	std::string str;
	my_tast(std::string st){
	this->str = st;	
	}
	int run(){
	cout<<"Run()...."<<str<<endl;
	}

};

int main(){

	E_PThread_Pool thread_pool(50,10,200);
	my_tast *tast1 = new my_tast("--------------"); 	
	my_tast *tast2 = new my_tast("++++++++++++++");
	my_tast *tast3 = new my_tast("00000000000000");
	my_tast *tast4 = new my_tast("222222222222222");
	my_tast *tast5 = new my_tast("555555555555555");
	my_tast *tast6 = new my_tast("666666666666666"); 	
	my_tast *tast7 = new my_tast("77777777777777777");
	my_tast *tast8 = new my_tast("888888888888888");
	my_tast *tast9 = new my_tast("9999999999999999");
	my_tast *tast10 = new my_tast("000000000000000S");

	sleep(4);
	long i=20000;
while(1){


	thread_pool.addTask(tast1);
	thread_pool.addTask(tast2);
	;
	thread_pool.addTask(tast3);
	thread_pool.addTask(tast4);

	thread_pool.addTask(tast5);
	thread_pool.addTask(tast6);
	thread_pool.addTask(tast7);


	thread_pool.addTask(tast9);
	thread_pool.addTask(tast10);	
	usleep(100000);
}

	sleep(2);	
	std::cout<<"<<<<<<<<<<<<<<<<<<<<<<<"<<i<<std::endl;
	

return 0;
}
